<?php

class PrintAction extends CommonAction{

	public function index(){
		$cardId	 = $_REQUEST['cardId'];
		$Y = date('Y',time());
		$m = date('m',time());
		$d = date('d',time());
		$today = strtotime("$Y-$m-$d");

		$Paylog = M('Paylog');
		$paylog = $Paylog->where("cardId={$cardId} AND payType=1 AND payTime>$today")->order('payTime desc')->select();
		$this  -> assign('paylog', $paylog);
		// 今日产品购买记录 end

		$Card     = M('Card');
		$card     = $Card->where('id='.$cardId)->find();
		$this     ->assign('card', $card);
		$this     ->display();
	}

	public function allList(){
		$cardId	 = $_REQUEST['cardId'];
		$Y = date('Y',time());
		$m = date('m',time());
		$d = date('d',time());

		$Paylog = M('Paylog');
		$paylog = $Paylog->where("cardId={$cardId} AND payType=1")->order('payTime desc')->select();
		$this  -> assign('paylog', $paylog);
		// 今日产品购买记录 end

		$Card     = M('Card');
		$card     = $Card->where('id='.$cardId)->find();
		$this     ->assign('card', $card);
		$this     ->display("index");
	}

}
?>